﻿<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page isELIgnored="false"%>
<c:set var="rootpath" value="${pageContext.request.contextPath}"></c:set>
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="msapplication-tap-highlight" content="no">
<meta name="description"
	content="Materialize is a Material Design Admin Template,It's modern, responsive and based on Material Design by Google. ">
<meta name="keywords"
	content="materialize, admin template, dashboard template, flat admin template, responsive admin template,">
<title>Materialize - Material Design Admin Template</title>

<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="${rootpath }/css/bootstrap.min.css">

<!-- Favicons-->
<link rel="icon"
	href="${rootpath }/resource/images/favicon/favicon-32x32.png"
	sizes="32x32">
<!-- Favicons-->
<link rel="apple-touch-icon-precomposed"
	href="${rootpath }/resource/images/favicon/apple-touch-icon-152x152.png">
<!-- For iPhone -->
<meta name="msapplication-TileColor" content="#00bcd4">
<meta name="msapplication-TileImage"
	content="${rootpath }/resource/images/favicon/mstile-144x144.png">
<!-- For Windows Phone -->

<!-- CORE CSS-->

<link href="${rootpath }/resource/css/materialize.css" type="text/css"
	rel="stylesheet" media="screen,projection">
<link href="${rootpath }/resource/css/style.css" type="text/css"
	rel="stylesheet" media="screen,projection">
<!-- Custome CSS-->
<link href="${rootpath }/resource/css/custom/custom.css" type="text/css"
	rel="stylesheet" media="screen,projection">

<!-- INCLUDED PLUGIN CSS ON THIS PAGE -->
<link href="${rootpath }/resource/js/plugins/prism/prism.css"
	type="text/css" rel="stylesheet" media="screen,projection">
<link
	href="${rootpath }/resource/js/plugins/perfect-scrollbar/perfect-scrollbar.css"
	type="text/css" rel="stylesheet" media="screen,projection">
<link
	href="${rootpath }/resource/js/plugins/chartist-js/chartist.min.css"
	type="text/css" rel="stylesheet" media="screen,projection">

<!--jsgrid css-->
<link href="${rootpath }/resource/js/plugins/jsgrid/css/jsgrid.min.css"
	type="text/css" rel="stylesheet" media="screen,projection">
<link
	href="${rootpath }/resource/js/plugins/jsgrid/css/jsgrid-theme.min.css"
	type="text/css" rel="stylesheet" media="screen,projection">

<style type="text/css">
.m-cursor {
	cursor: pointer
}
</style>

</head>

<body>
	<!-- Start Page Loading -->
	<div id="loader-wrapper">
		<div id="loader"></div>
		<div class="loader-section section-left"></div>
		<div class="loader-section section-right"></div>
	</div>
	<!-- End Page Loading -->

	<!-- //////////////////////////////////////////////////////////////////////////// -->

	<!-- START HEADER -->
	<header id="header" class="page-topbar">
		<!-- start header nav-->
		<div class="navbar-fixed">
			<nav class="navbar-color">
				<div class="nav-wrapper">
					<ul class="left">
						<!--图标-->
						<li>
							<h1 class="logo-wrapper">
								<a href="console" class="brand-logo darken-1"><img
									src="${rootpath }/resource/images/materialize-logo.png"
									alt="materialize logo"></a>
							</h1>
						</li>
					</ul>

					<ul class="right hide-on-med-and-down">
						<li><a href="javascript:void(0);"
							class="waves-effect waves-block waves-light toggle-fullscreen"><i
								class="mdi-action-settings-overscan"></i></a></li>
						<li><a href="javascript:void(0);"
							class="waves-effect waves-block waves-light notification-button"
							data-activates="notifications-dropdown"><i
								class="mdi-social-notifications"><small
									class="notification-badge">5</small></i> </a></li>
					</ul>
				</div>
			</nav>
		</div>
		<!-- end header nav-->
	</header>
	<!-- END HEADER -->
	<!-- //////////////////////////////////////////////////////////////////////////// -->
	<!-- START MAIN -->
	<div id="main">
		<!-- START WRAPPER -->
		<div class="wrapper">
			<!-- START LEFT SIDEBAR NAV-->
			<aside id="left-sidebar-nav">
				<ul id="slide-out" class="side-nav fixed leftside-navigation">
					<!--控制面板-->
					<li class="bold"><a href="console"
						class="waves-effect waves-cyan"><i
							class="mdi-action-dashboard"></i>控制台</a></li>
					<li class="no-padding active">
						<ul class="collapsible collapsible-accordion">
							<li class="bold"><a
								class="collapsible-header waves-effect waves-cyan active"><i
									class="mdi-action-view-carousel"></i> BLOG管理</a>
								<div class="collapsible-body">
									<ul>
										<li class="active"><a href="console_blog_list">文章列表</a></li>
										<li><a href="console_blog_add">添改文章</a></li>
									</ul>
								</div></li>
						</ul>
					</li>
					<li>
							<a href="console_notice" class="waves-effect waves-cyan"><i class="mdi-action-assignment"></i>公告栏设置</a>
						</li>
				</ul>
			</aside>

			<section>
				<div class="container">
					<!--Striped Table-->
					<div class="divider"></div>
					<div id="striped-table">
						<div class="row">
							<table class="striped">
								<thead>
									<tr>
										<th>编号</th>
										<th>标题</th>
										<th>发布时间</th>
										<th>阅读数</th>
										<th>评论数</th>
										<th>是否发布</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>

									<c:forEach var="essay" items="${essays}">
										<tr>
											<td>${essay.id }</td>
											<td>${essay.title }</td>
											<td>${essay.time }</td>
											<td>${essay.reading }</td>
											<td>${essay.comment }</td>
											<td><c:choose>
													<c:when test="${essay.open}">
														<a class="m-cursor" title="取消发布"
															href="console_blog_close?id=${essay.id }"><span
															class="glyphicon glyphicon-ok"></span></a>
													</c:when>
													<c:otherwise>
														<a class="m-cursor" title="发布"
															href="console_blog_open?id=${essay.id }"><span
															class="glyphicon glyphicon-remove"></span></a>
													</c:otherwise>
												</c:choose></td>
											<td><a title="编辑" class="m-cursor"
												href="console_blog_update?id=${essay.id}"> <span
													class="glyphicon glyphicon-pencil"></span></a> <a title="删除"
												class="m-cursor" onclick="return delete_p()"
												href="console_blog_delete?id=${essay.id}"><span
													class="glyphicon glyphicon-trash"></span></a></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</div>

				</div>
			</section>


			<!-- LEFT RIGHT SIDEBAR NAV-->

		</div>

		<!-- END WRAPPER -->

	</div>

	<!-- ================================================
    Scripts
    ================================================ -->
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="${rootpath }/js/bootstrap.min.js"></script>

	<!-- jQuery Library -->
	<script type="text/javascript"
		src="${rootpath }/resource/js/plugins/jquery-1.11.2.min.js"></script>
	<!--materialize js-->
	<script type="text/javascript"
		src="${rootpath }/resource/js/materialize.js"></script>
	<!--prism-->
	<script type="text/javascript"
		src="${rootpath }/resource/js/plugins/prism/prism.js"></script>
	<!--scrollbar-->
	<script type="text/javascript"
		src="${rootpath }/resource/js/plugins/perfect-scrollbar/perfect-scrollbar.min.js"></script>
	<!-- chartist -->
	<script type="text/javascript"
		src="${rootpath }/resource/js/plugins/chartist-js/chartist.min.js"></script>

	<!--plugins.js - Some Specific JS codes for Plugin Settings-->
	<script type="text/javascript"
		src="${rootpath }/resource/js/plugins.js"></script>
	<!--custom-script.js - Add your own theme custom JS-->
	<script type="text/javascript"
		src="${rootpath }/resource/js/custom-script.js"></script>

	<!--jsgrid-->
	<script type="text/javascript"
		src="${rootpath }/resource/js/plugins/jsgrid/js/db.js"></script>
	<!--data-->
	<script type="text/javascript"
		src="${rootpath }/resource/js/plugins/jsgrid/js/jsgrid.min.js"></script>
	<script type="text/javascript"
		src="${rootpath }/resource/js/plugins/jsgrid/js/jsgrid-script.js"></script>

	<script type="text/javascript">
		function delete_p() {
			if (confirm("确认删除？")) {
				return true;
			} else {
				return false;
			}
		}
	</script>

</body>

</html>